package main

import (
	"fmt"
	"gopkg.in/robfig/cron.v2"
	"time"
)

func testCron() {
	c := cron.New()
	c.AddFunc("*/1 * * * * ?", func() {
		fmt.Println(time.Now())
	})
	c.Start()

	go func() {
		entries := c.Entries()
		for i, e := range entries {
			fmt.Println(i, e.Job)
		}
	}()

	fmt.Println("start...")
	time.Sleep(time.Second * 10)
	c.Stop()
	fmt.Println("stop!")
}

